<script type="text/template" id="cakeTable-template">
    <div class="fixed-table">
        <@if(option.fixedHeader){@>
            <div class="fixed-table-head">
                <@if(option.showNum){@>
                    <@if(option.numType==1){@>
                        <div><span>序号</span><i class="fa hearer-fa"></i></div>
                    <@}else if(option.numType==2){@>
                        <div>
                            <div class="property-all" style="border:0;margin-left: calc(50% - 39px);width: 74px;" name="tableCheck">
                                <div class="user-check check-all"></div>
                                <div class="user-check-text ellipsis" style="width: 50px;border:0;">全选</div>
                            </div>
                        </div>
                    <@}@>
                <@}@>
                <@$.each(option.head,function(i,n){@>
                    <@if(option.sort){@>
                        <@if(Util.isEmpty(n.sort) || n.sort){@>
                            <div data-sort=1 data-sortype="<@=Util.isEmpty(n.sortType)?'common':n.sortType@>"><span><@=n.name@></span><i class="fa hearer-fa"></i></div>
                        <@}else{@>
                            <div data-sort=0 ><span><@=n.name@></span><i class="fa hearer-fa"></i></div>
                        <@}@>
                    <@}else{@>
                        <@if(Util.isEmpty(n.sort) || !n.sort){@>
                            <div data-sort=0 ><span><@=n.name@></span><i class="fa hearer-fa"></i></div>
                        <@}else{@>
                            <div data-sort=1 data-sortype="<@=Util.isEmpty(n.sortType)?'common':n.sortType@>"><span><@=n.name@></span><i class="fa hearer-fa"></i></div>
                        <@}@>
                    <@}@>
                <@})@>
            </div>
        <@}@>
        <div class="fixed-table-body">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <@if(option.showNum){@>
                        <@if(option.numType==1){@>
                            <th nowrap="nowrap"><span>序号</span><i class="fa hearer-fa"></i></th>
                        <@}else if(option.numType==2){@>
                            <th nowrap="nowrap">
                                <div class="property-all disabled" style="border:0;" name="tableCheck">
                                    <div class="user-check check-all"></div>
                                    <div class="user-check-text ellipsis" style="width: 50px;border:0;">全选</div>
                                </div>
                            </th>
                        <@}@>
                    <@}@>
                    <@$.each(option.head,function(i,n){@>
                    <th nowrap="nowrap" style="<@=Util.isEmpty(n.style)?'':n.style@>">
                        <span><@=n.name@></span><i class="fa hearer-fa"></i>
                    </th>
                    <@})@>
                </tr>
                </thead>
                <tbody>
                <@if(Util.isEmpty(option.columns)){@>
                <tr><td colspan="<@=option.head.length+((option.showNum)?1:0)@>">暂无数据</td></tr>
                <@}else if(option.type==1){@>
                    <@$.each(option.columns,function(i,n){@>
                    <tr>
                        <@if(option.showNum){@>
                            <@if(option.numType==1){@>
                                <td><@=i+1@></td>
                            <@}else{@>
                                <td>
                                    <div class="property" style="width: 74px;" name="tableCheck">
                                        <div class="user-check"></div>
                                        <div class="user-check-text ellipsis" style="width: 50px;"><@=i+1@></div>
                                    </div>
                                </td>
                            <@}@>
                        <@}@>
                        <@$.each(option.head,function(k,l){
                            var a = "";
                            if(Util.isEmpty(n[l.field])){
                                a = "-";
                            }else{
                                if (l.format=="time") {
                                    a = new Date(n[l.field]).format("yyyy-MM-dd HH:mm:ss");
                                }else if(l.format=="date"){
                                    a = new Date(n[l.field]).format("yyyy-MM-dd");
                                }else if(l.format=="hour"){
                                    a = new Date(n[l.field]).format("HH:mm:ss");
                                }else{
                                    a = n[l.field]
                                };
                            }@>
                            <@ var max = Util.isEmpty(l.size)?35:parseInt(l.size) @>
                            <@if(a.length>max && (Util.isEmpty(l.type) || l.type==1)){@>
                                <td class="show_dt" value="<@=a@>" ><@=a.substring(0,max)+"..."@></td>
                            <@}else{@>
                                <@if(!Util.isEmpty(l.rule)){var flg1=false;@>
                                    <@$.each(l.rule,function(ii,nn){@>
                                        <@if(ii==a){flg1=true;@>
                                            <td><@=nn@></td>
                                        <@}@>
                                    <@})@>
                                    <@if(!flg1){@>
                                        <td>-</td>
                                    <@}@>
                                <@}else{@>
                                    <td><@=a@></td>
                                <@}@>
                            <@}@>
                        <@})@>
                    </tr>
                    <@})@>
                <@}else if(option.type==2){@>
                    <@$.each(option.columns,function(i,n){@>
                        <@if(!Util.isEmpty(n[option.groupKey])){@>
                            <tr group="<@='group_'+i@>" class="table-group-fa"><td colspan="<@=option.head.length+((option.showNum)?1:0)@>"><div class="groupTitle"><a class="add">+</a><@=n[option.groupName]@></div></td></tr>
                            <@$.each(n[option.groupKey],function(j,m){@>
                                <tr groupChild="<@='group_'+i@>" class="table-group-ch">
                                    <@if(option.showNum){@>
                                        <td><@=j+1@></td>
                                    <@}@>
                                    <@$.each(option.head,function(h,o){@>
                                        <td><@=m[o.field]@></td>
                                    <@})@>
                                </tr>
                            <@})@>
                        <@}@>
                    <@})@>
                <@}@>
                </tbody>
            </table>
        </div>
        <@if(option.pageType=="out"){@>
        <div class="tableHeaderMenu"></div>
    </div>
        <@}@>
        <@if(option.showPage){@>
        <div class="fixed-table-foot">
            <div class="page-con">
                <div class="page-num">
                    <a href="javascript:void(0)" class="backNext page-before"> 上一页</a>
                    <@  var pageAct = option.pageInfo.currentPage;
                        var totalPage = option.pageInfo.totalPage;
                        var showPageNum = 5,pageStart=null,pageEnd=null;
                        var beforeCur = parseInt(showPageNum/2);
                        if(pageAct <= showPageNum-beforeCur){
                            pageStart=1;
                        }else{
                            pageStart= pageAct - beforeCur;
                        }
                        if(pageStart >= (totalPage - showPageNum + 1)){
                            pageStart = totalPage - showPageNum + 1;
                        }
                        if(pageStart<1){pageStart = 1;}
                        pageEnd = pageStart + showPageNum - 1;
                        if(pageEnd > totalPage){pageEnd = totalPage;}
                    @>
                    <@for(var i=pageStart;i<=pageEnd;i++){@>
                        <a href="javascript:void(0)" class="page-block <@=pageAct==i?'active':''@>"><@=i@></a>
                    <@}@>
                    <a href="javascript:void(0)" class="backNext page-next">下一页</a>
                </div>
                <span>每页<span style="margin:0 3px">
                    <select style="width: 60px;height:31px;" class="pageSize">
                        <@for(var i=0;i<6;i++){ var arr = [10,20,50,100,200,500]@>
                        <option value="<@=arr[i]@>" <@=pageInfo.pageSize==arr[i]?selected='selected':''@>><@=arr[i]@></option>
                        <@}@>
                    </select>
                </span>条</span>
                <span style="margin: 0 25px;">
                     共<span class="pageCount"><@=pageInfo.totalPage@></span>页
                </span>
                <span>
                    共<span class="records"><@=pageInfo.totalRecords@></span>条记录
                </span>
                <span style="margin-left: 20px;">跳转至</span>
                <input id="jump" type="tel" class="form-control jump"/>
                <button class="btn btn-warning">GO</button>
            </div>
        </div>
        <@}@>
    <@if(option.pageType=="inside"){@>
    <div class="tableHeaderMenu"></div>
    </div>
    <@}@>
</script>
<script type="text/template" id="pop-dialog-template">
    <div class="pop-box pop-dialog pop-mask dialog-center">
        <div class="box-dialog">
            <div class="pop-head"><@=popTitle@> <div class="pop-close">×</div>  </div>
            <div class="pop-container" style="max-height:<@=maxHeight@>"><@=popContent@></div>
            <@ if(showPopFooter && Util.isEmpty(footer)){ @>
            <div class="pop-footer">
                <button class="btn btn-primary pop-ok" style="margin-right: 35px;"><@=popOkText@></button>
                <@if(popCancelShow){@>
                    <button class="btn btn-default pop-cancel"><@=popCancelText@></button>
                <@}@>
            </div>
            <@}else{@>
                <@=footer@>
            <@}@>
        </div>
    </div>
</script>
<script type="text/template" id="pop-right-template">
    <div class="pop-box box-dialog dialog-right">
        <div class="pop-header">
            <div class="pop-title"><@=popTitle@></div>
        </div>
        <div class="pop-container">
            <@=popContent@>
        </div>
        <@if(showPopFooter){@>
        <div class="pop-footer">
            <@if(popOkShow){@><div class="pop-btn pop-ok"><@=popOkText@></div><@}@>
            <@if(popCancelShow){@><div class="pop-btn pop-cancel"><@=popCancelText@></div><@}@>
        </div>
        <@}@>
    </div>
</script>
<script type="text/template" id="pop-alert-template">
    <div class="pop-box pop-alert pop-mask  dialog-center">
        <div class="box-dialog">
            <div class="pop-head"><@=popTitle@> <div class="pop-close">×</div> </div>
            <div class="pop-container"><@=popContent@></div>
            <@ if(showPopFooter && Util.isEmpty(footer)){ @>
            <div class="pop-footer">
                <button class="btn btn-primary pop-ok"><@=popOkText@></button>
            </div>
            <@}@>
        </div>
    </div>
</script>
<script type="text/template" id="pop-confirm-template">
    <div class="pop-box pop-alert pop-mask  dialog-center">
        <div class="box-dialog">
            <div class="pop-head"><@=popTitle@> <div class="pop-close">×</div> </div>
            <div class="pop-container"><@=popContent@></div>
            <@ if(showPopFooter && Util.isEmpty(footer)){ @>
            <div class="pop-footer">
                <button class="btn btn-primary pop-ok"><@=popOkText@></button>
                <button class="btn btn-default pop-cancel"><@=popCancelText@></button>
            </div>
            <@}@>
        </div>
    </div>
</script>
<script type="text/template" id="menu-template">
    <div class="commonBody-body">
        <div class="commonBody-leftMenu">
            <div class="common-menu-head">MENUS</div>
            <div class="common-menu-box">
                <@$.each(userInfo.menuCode,function(i,n){@>
                    <@if(!Util.isEmpty(menu[n])){@>
                    <a href="javascript:void(0)" class="menu <@=i==0?'on':''@>" name="<@=menu[n].name@>" onclick="ModuleRouter.init('<@=menu[n].name@>')"><@=menu[n].text@></a>
                    <@}@>
                <@})@>
            </div>
            <div class="common-foot">
                <div class="">V2.0 copyright © htdatacloud</div>
                <div class="">江苏华通晟云科技有限公司</div>
            </div>
        </div>
        <div class="commonBody-rightBody"></div>
    </div>
</script>
<script type="text/template" id="topMenu-template">
    <@$.each(menuCode,function(i,n){@>
        <@if(!Util.isEmpty(keyVal[n])){@>
            <@if(n == "index"){@>
                <div class='header-module' name='<@=keyVal[n].code@>' onclick="ModuleRouter.init('<@=keyVal[n].code@>')"><@=keyVal[n].name@></div>
            <@}else{@>
                <div class='header-module' onclick="ModuleRouter.loadLeftTemp('<@=keyVal[n].code@>')"><@=keyVal[n].name@></div>
            <@}@>
        <@}@>
    <@})@>
</script>